﻿@inherits UiComponentBase

<input id="confirmDelete" type="checkbox" @bind-value="confirmDelete" class="@CheckboxClasses">
<label for="confirmDelete" class="@LabelClasses">@ConfirmLabel</label>
<button type="button" disabled=@(!confirmDelete) @onclick="OnDelete"
        class=@ClassNames(ButtonClasses,
        confirmDelete? EnabledClasses : DisabledClasses, Class)>
    @if (ChildContent != null)
    {
        @ChildContent
    }
    else
    {
        @Label
    }
</button>

@code {
    public static string CheckboxClasses { get; set; } = "focus:ring-indigo-500 h-4 w-4 text-indigo-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-black";
    public static string LabelClasses { get; set; } = "mx-1 select-none dark:text-gray-300";
    public static string ButtonClasses { get; set; } = "select-none inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white";
    public static string EnabledClasses { get; set; } = "cursor-pointer bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500";
    public static string DisabledClasses { get; set; } = "bg-red-400";
}